package com.example.learnnacos;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Slf4j
@RestController
@RefreshScope
public class HelloController {

    @GetMapping("/hello/time")
    public Map<String, Object> index() {
        log.info("time: {}", System.currentTimeMillis());
        return Map.of("time", System.currentTimeMillis());
    }
}
